package Set_inface_study;

import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

public class HashSet1 {
    public static void main(String[] args) {
        Set<Integer> set = new HashSet<>();
        set.add(1);
        set.add(3);
        set.add(2);
        set.add(1);
        Iterator<Integer> it = set.iterator();
        while(it.hasNext())
        {
            int n = it.next();
            System.out.print(n+"     ");
            //1     2     3     输出123表示不允许重复，且无序
        }
    }
}
